﻿using System.Reflection;

namespace BoxBinary.Foundations.OperationalManagement.Resources
{
    /// <summary>
    /// 
    /// </summary>
    public class ExceptionResourceReader : LocalizedResourceReader
    {
        private const string ResourceNamespace = "Resources.Exceptions";

        private static ExceptionResourceReader _default;

        /// <summary>
        /// Initializes a new instance of the <see cref="ExceptionResourceReader"/> class.
        /// </summary>
        protected internal ExceptionResourceReader()
        {
        }

        /// <summary>
        /// Gets the default.
        /// </summary>
        /// <value>The default.</value>
        public new static ExceptionResourceReader Default
        {
            get
            {
                if (_default == null)
                    _default = new ExceptionResourceReader();
                return _default;
            }
        }

        /// <summary>
        /// Gets the string.
        /// </summary>
        /// <param name="defaultNamespace">The default namespace.</param>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        public string GetString(string defaultNamespace, string key)
        {
            return GetString(defaultNamespace, ResourceNamespace, key, Assembly.GetCallingAssembly());
        }
    }
}